package com.sh.learn.itcast.javaadvanced.aop;

import java.lang.reflect.Method;

public class MyAdvice implements Advice {

	@Override
	public void beforeMethod(Object target, Method method, Object[] args) {
		long beginTime = System.currentTimeMillis();
		System.out.println(beginTime);
	}

	@Override
	public void afterMethod(Object target, Method method, Object[] args) {
		long endTime = System.currentTimeMillis();
		System.out.println(endTime);
	}

	@Override
    public void catchException(Object target, Method method, Object[] args, Exception e) {
		System.out.println(e.getMessage());
    }

}
